Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start batching combiner requests #297

Merged
merged 14 commits into from
Jan 9, 2024

Conversation

aomerk
Copy link
Contributor

@aomerk aomerk commented Jan 8, 2024

Adds batch request support to combiner feed.

Idea is to use aliases in graphql queries, raw request being as follows:
Query:

query AliAliasQuery($input0: AlertsInput, $input1: AlertsInput) {
  alerts0: alerts(input: $input0) {
      alerts {
          createdAt
          
      }
    pageInfo {
      hasNextPage
      endCursor {
        alertId
        blockNumber
      }
    }
  }
  alerts1: alerts(input: $input1) {
    pageInfo {
      hasNextPage
      endCursor {
        alertId
        blockNumber
      }
    }
  }
}

Inputs:

{
    "input0": {
        "first": 999999999,
        "createdSince":300000,
        "blockSortDirection": "asc",
        "bots": ["0x80ed808b586aeebe9cdd4088ea4dea0a8e322909c0e4493c993e060e89c09ed1"]
    },
   "input1": {
        "first": 11,
        "createdSince":300000,
        "bots": ["0x80ed808b586aeebe9cdd4088ea4dea0a8e322909c0e4493c993e060e89c09ed1"]
    }
}

Response:

{
    "errors": [
        {
            "message": "Invalid limit value (min value: 1, max: 9999)",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "alerts0"
            ],
            "extensions": {
                "code": "BAD_USER_INPUT"
            }
        }
    ],
    "data": {
        "alerts0": null,
        "alerts1": {
            "pageInfo": {
                "hasNextPage": false,
                "endCursor": {
                    "alertId": "",
                    "blockNumber": 0
                }
            }
        }
    }
}
  • Due to the authorization mechanism, combiner requests are batched per bot
  • for experimental reasons, batch size is set to 10 for now, could easily be increased to 50

@aomerk aomerk merged commit 202eb54 into master Jan 9, 2024
1 check passed
@canercidam canercidam deleted the ali/forta-1509-batch-combiner-requests branch January 10, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants